<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1.()分组
      //   var reg = /^(ab){2}\d+$/;
      //   var str = "abab11";
      //   console.log(reg.test(str));

      // 2.|表示或者关系
      //   var reg = /a|b/;
      //   var str = "byuhg";
      //   console.log(reg.test(str));
      // 3.[]集合
      //   var reg = /^[abc]\d+\w$/;
      //   var str = "a123t";
      //   console.log(reg.test(str));
      var reg = /[0-9]/;
      var str = "6";
      console.log(reg.test(str));
    </script>
  </body>
</html>
